back soft

ساخت وبلاگ

Vote count: -1

I have an array which contains 4 different objects and looks like this:

[ { a: 1, b: 12, c: 3 }, { a: 15, d: 1, e: 8 }, {b: 2, d:6 }, {a: 1} ]

I want to retu one object with the sum of each object's values added together.

I am looking to retu the following object:

{a: 17, b: 14, c: 3, d: 7; e: 8}

I have attempted many different solutions, and also checked here for which I surprisingly could not find a solution. This was as close as I found, but could still not solve the issue.

asked 3 mins ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 360 تاريخ : جمعه 30 بهمن 1394 ساعت: 22:38

Vote count: 0

I can't get Fancybox to work on my site

JQuery is doing 3 things on this page: Showing and Hiding the various sections of the site, a Carousel for menus, and Fancybox.

On a previous version of the site, there were no carousel menus, and Fancybox worked fine, so I have to think there's a conflict between Carousel and Fancybox.

I resolved a previous conflict between Carousel and the Show/Hide feature by changing their order in the head.

asked 2 mins ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 414 تاريخ : جمعه 30 بهمن 1394 ساعت: 22:38

Vote count: 0

Hello i am fairly new to programming in C and basically the decrypt array only holds the first value entered into in below is my code also any tips to help me improve are appreciated;

int main(int argc, char *argv[]) {
char input[100] = "";
char target[0] = "";
char replace[0] = "";
char keycipher[100] = "";
int i, size;
static char decrypt[100] = ""; while(1){ printf("nEnter Target: "); fgets(target, 17, stdin); printf("Replace With: "); fgets(replace, 17, stdin); for(i = 0; i < size; i++) { if(input[i] == target[0]) { decrypt[i] = target[i];<-this is where it is supposed to be added input[i] = replace[0]; printf("n%s",input); printf("n%s",decrypt); } } if(target[0] == 'q' || replace[0] == 'q'){ break; }
}
printf("decryt @# %s", decrypt);
printf("nDecrypting .....n");
printf("Your orginal string was: ");
for(i = 0; i < 100; i++) { input[i] = decrypt[i]; printf("%s", input); }
printf("nSIMULATION OVER!n");
system("PAUSE");
retu 0;
}

the output i receive is as follows;

*--------------------------*
| Welcome to the Scrambler |
*--------------------------* Remember press q to quit
Please enter a string: hello stranger
you entered: hello stranger
Enter target: h
Replace with: w
wello stranger
decrypt array: h
Enter target: s
Replace with: p
wello ptranger
decrypt array: h <-------- why is this still just h?
Enter target: q
Replace with:
decrypt holds: h <----------
Decrypting .....
Your original string was: hello ptrangerhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
SIMULATION OVER!

also how can i check if the target is already in the array so they can`t add that character?

asked 2 mins ago

1 Answer

Vote count: 0

The problem is in

char target[0] = "";
char replace[0] = "";

zero-length arrays cannot be used meaningfully.

answered 12 secs ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 313 تاريخ : جمعه 30 بهمن 1394 ساعت: 22:38

Vote count: 0

Whenever I try to create a new student, my code just doesn't work, regardless of my entry. This method should split a string at a space, and if there are 0 spaces, or more than two, then an error message should be printed, and the value of name shouldn't change. If there is one space present, then the substring before the space becomes firstName and the substring after becomes lastName. If there are two spaces, then the substring before the first space becomes firstName, the one after the first space becomes middleName, and the one after the second space becomes lastName. I'm not sure what I am doing wrong here since my code compiles, but whenever I try to call this method, no student is created.

public void setName(String newName)
{ String[] nameInput = newName.split(" "); int count = 0; int i = 0; for (String userName : nameInput) { while(i < newName.length()) if(newName.charAt(i) == ' ') { count++; } if (count == 0) { System.out.println("Error, please enter at least two names."); newName = null; } else if(count==1) { firstName = nameInput[1]; middleName = ""; lastName = nameInput[2]; newName = firstName + " " + lastName; } else if(count == 2) { firstName = nameInput[1]; middleName = nameInput[2]; lastName = nameInput[3]; newName = firstName + middleName + lastName; } else { System.out.println("Error! You can only enter up to three names."); } }
}
asked 54 secs ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 373 تاريخ : جمعه 30 بهمن 1394 ساعت: 12:36

Vote count: 0

What I want is that output date should vary according to the input date and value selected of days to stay(d_stay),that is outputdate=inputdate(i_d)+value(d_stay),and it should change dynamically ,without refreshing the page.

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link href="http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet"> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <script> $(function () { var dataSrc = ["australia", "austria", "antartica", "argentina", "algeria"]; $("#myText").autocomplete({minLength:3,source:dataSrc }); }); </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Make MY TRIP</title> </head> <body> <?php If(isset($_REQUEST['submit'])!='') { If($_REQUEST['s_state']=='' || $_REQUEST['s_date']=='' || $_REQUEST['myText']=='') { Echo "please fill the empty field."; } Else { $s=$_POST["myText"]; $i_d=$_POST["s_date"]; $date = DateTime::createFromFormat("Y-m-d", $i_d); echo "Inputdate";echo "&nbsp"; echo $date->format("d F"); echo "&nbsp"; echo "&nbsp"; // echo "out date"; echo " <html> <head> <body> <form method='Post'> <select name='d_stay'> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> <option value='4'>4</option> <option value='5'>5</option> <option value='6'>6</option> <option value='7'>7</option> </select> </body> </head> </html> "; } } ?> <p> Starting City <form method="post" action="23.php"> <select name="s_state"> <option value="Shimla">Shimla</option> <option value="Delhi">Delhi</option> <option value="Chandigarh">Chandigarh</option> <option value="Pune">Pune</option> </select> Starting date <input type="date" name="s_date" /> <p> <input id="myText" placeholder="Add city you wish to travel" name="myText" role="textbox"/> </p> <input type="submit" name="submit" value="submit" /> </form> </p> </body> </html>
asked 58 secs ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 406 تاريخ : جمعه 30 بهمن 1394 ساعت: 12:36

Vote count: 0

I am building a web scraper in CasperJS. I am trying to iterate over the allLinks array which contains all the links I want to scrape. Following are code snippets that I have tried.

1)

casper.then(function(){ this.each(allLinks,function(self,link){ console.log("Inside the each function"); console.log(link); (function(link){ this.thenOpen(link,function(a){ console.log("Inside function that extracts data"); console.log(link); })(link);
}); });

2)

casper.then(function(){ var i = 0; var length = allLinks.length; var arr = new Array(75); //console.log(length); //console.log(allLinks); casper.repeat(length,function(){
arr[i] = allLinks[i]; //console.log(length); console.log(i); link = allLinks[i]; //console.log("Inside function each "); console.log("1" + link); //console.log(typeof(link)); //var eachLink = getLink(link); i++; if (i == 74) { console.log(arr.length); console.log(arr); }
}); });

3)

 casper.then(function(){ while(j < allLinks.length) { console.log("Inside the each function"); //console.log(allLinks); this.thenOpen(allLinks[j],function(a){ console.log("Inside function that extracts data"); console.log(j); console.log(allLinks[j]); }; j = j + 1; }); });

4)

casper.then(function(){ for(j = 0; j < allLinks.length; j++) { console.log("Inside the each function"); //console.log(allLinks); this.thenOpen(allLinks[j],function(a){ console.log("Inside function that extracts data"); console.log(j); console.log(allLinks[j]); }; });
});

5)

casper.then(function(){ this.each(allLinks,function(self,link){ console.log("Inside the each function"); console.log(link); this.thenOpen(link,function(a){ console.log("Inside function that extracts data"); console.log(link);
}; }); });
asked 50 secs ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 336 تاريخ : جمعه 30 بهمن 1394 ساعت: 12:36

Vote count: 0

I have a datetime value to pass into SqlParameter. DateTime object value

However when pass to myCmd.Parameters.Add("@TrxDate", adt_TrxDate); SqlParameter SqlValue & Value property is difference value

Found that it add a day when executing query. I found this issue in profiler and finally find out SqlParameter SqlValue & Value property is difference value. Why it is happen and any idea?

asked 2 mins ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 340 تاريخ : جمعه 30 بهمن 1394 ساعت: 8:14

Vote count: 0

i have a service with this code

public class service extends Service{
private AlarmManager alarm;
private PendingIntent addData, sendData, fullData;
// run on another Thread to avoid crash
private Handler mHandler = new Handler();
@Override
public IBinder onBind(Intent intent) { retu null;
}
@Override
public void onDestroy() { if(!App.User.GetUserCode().equals("")){ App.DataFrame.InfoLog("Location is tued OFF"); App.DataFrame.Off(); mHandler.postDelayed(new Runnable() { @Override public void run() { stopAlarm(); Intent stoploc = new Intent(service.this, LocationProvider.class); service.this.stopService(stoploc); stopForeground(true); stopSelf(); App.User.Logout(); App.Toast("Stopping Service"); } }, 1000); }else{ stopAlarm(); Intent stoploc = new Intent(service.this, LocationProvider.class); service.this.stopService(stoploc); stopForeground(true); stopSelf(); App.Toast("Stopping Service"); } super.onDestroy();
}
public void stopAlarm(){ alarm.cancel(addData); alarm.cancel(sendData); alarm.cancel(fullData);
}
@Override
public void onCreate() { App.Toast("Starting Services"); alarm = (AlarmManager) getSystemService(App.GetContext().ALARM_SERVICE); Intent intent = new Intent(this, CoorReceiver.class); addData = PendingIntent.getBroadcast(this, 0, intent.putExtra("Code", 0), PendingIntent.FLAG_UPDATE_CURRENT); sendData = PendingIntent.getBroadcast(this, 1, intent.putExtra("Code", 1), PendingIntent.FLAG_UPDATE_CURRENT); fullData = PendingIntent.getBroadcast(this, 2, intent.putExtra("Code", 2), PendingIntent.FLAG_UPDATE_CURRENT); alarm.setInexactRepeating(AlarmManager.RTC_WAKEUP, 15000, 15000, addData); alarm.setInexactRepeating(AlarmManager.RTC_WAKEUP, 300000, 300000, sendData); alarm.setInexactRepeating(AlarmManager.RTC_WAKEUP, 600000, 600000, fullData);
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) { Intent intent2 = new Intent(this, MainActivity.class); intent2.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent pendIntent = PendingIntent.getActivity(this, 0, intent2, 0); Notification noti = new Notification.Builder(getApplicationContext()) .setContentTitle("Imagine") .setContentText("Service is Running") .setSmallIcon(R.drawable.ic_launcher) .setContentIntent(pendIntent) .build(); startForeground(1234, noti); retu START_STICKY;
}
}

and a broadcastreceiver

public class CoorReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) { int code = intent.getIntExtra("Code", 0); if(code == 0){ App.DataFrame.AddPresentCoordinate(); App.Toast("Get"); try{ if(App.Location.IsNetworkEnabled() == false && App.Location.IsGPSEnabled() == false){ context.stopService(new Intent(context, service.class)); } }catch (RuntimeException e){ App.DataFrame.ErrorLog("Checking GPS Status", e.getMessage()); } }else if(code == 1){ App.DataFrame.SendValidData(); App.Toast("Send"); }else if(code == 2){ App.DataFrame.SendFullData(); App.Toast("Full"); }
}
}

when I plug my phone to my PC via usb and do debugging with a few breakpoint, the alarm will call receiver every 15s, 5min, and 10min
but when I generate the signed apk(release or debug), the alarm won't call the receiver
does anyone have same problem? or any solution?

asked 2 mins ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 399 تاريخ : جمعه 30 بهمن 1394 ساعت: 8:14

Vote count: 0

guys and gals! I'm pretty new to Ruby and I've run across a problem with something that I'm not entirely sure how to work.

As a challenge, a friend told me to create a program that determines whether or not a person can participate in an activity based on their height. If their height in centimeters/inches/whatever is a perfect square, then they can go, if not, they can't. This is what I have now:

print "Input height here:"
def height_input input = gets.to_i input**0.5
end
if height_input.integer? print "Congrats, you're in!"
else print "Sorry, we can't let you in."
end

I'm certain that the last 'if' statement doesn't work the way I want it to because the method retus a float value (example: input=64 => 8.0) and not a normal, whole number integer. If I add a (.to_i) to the end of the method, or if I call the method to make the value an integer, it gives me the first digit of the root in integer form. That isn't bad if I do in fact have a perfect square, but if it's not a perfect square, then I get the same result as if I did. Help?

asked 2 mins ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 367 تاريخ : جمعه 30 بهمن 1394 ساعت: 8:14

Vote count: 0

Subject: MyBatis: Boolean Paraeter: MyBatis is using Getter

Content:

Hello everyone,

I have been searching for a while for a solution to my nearly-simple MyBatis problem:


Given code (only the necessary parts):

mybatis-config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration> <typeAliases> <!-- Model types. --> <typeAlias type="com.blockhaus2000.bh2k.portal.data.model.Navigation" alias="Navigation" /> <!-- ... more types ... ---> </typeAliases> <mappers> <mapper resource="mapper/NavigationDAO.xml" /> <!-- ... more mappers ... --> </mappers>
</configuration>

NavigationDAO.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.blockhaus2000.bh2k.portal.data.dao.NavigationDAO"> <resultMap type="Navigation" id="navigationResultMap"> <id property="id" column="navigationId" /> <result property="title" column="navigationTitle" /> <result property="order" column="navigationOrder" /> <result property="visible" column="navigationVisible" /> <discriminator javaType="String" column="resolve"> <case value="yes" resultMap="enhancedNavigationResultMap" /> </discriminator> </resultMap> <resultMap type="Navigation" id="enhancedNavigationResultMap" extends="navigationResultMap"> <collection property="navigationEntries" ofType="NavigationEntry"> <id property="navigationId" column="navigationId" /> <id property="pageId" column="pageId" /> <result property="title" column="navigationEntryTitle" /> <result property="order" column="navigationEntryOrder" /> <result property="visible" column="navigationEntryVisible" /> </collection> </resultMap> <!-- Methods from BaseDAO. --> <insert id="insert" parameterType="Navigation" useGeneratedKeys="true" keyProperty="id" keyColumn="navigationId"> <!-- SQL --> </insert> <insert id="save" parameterType="Navigation"> <!-- SQL --> </insert> <delete id="delete" parameterType="Navigation"> <!-- SQL --> </delete> <select id="exists" parameterType="Navigation" resultType="boolean"> <!-- SQL --> </select> <!-- Methods from UpdateableDAO. --> <update id="update" parameterType="Navigation"> <!-- SQL --> </update> <!-- Methods from NavigationDAO. --> <select id="findVisibleNavigations" parameterType="boolean" resultMap="navigationResultMap"> SELECT N.navigationId, N.navigationTitle, N.navigationOrder, N.navigationVisible, <if test="resolve"> NE.pageId, NE.navigationEntryTitle, NE.NavigationEntryOrder, NE.navigationEntryVisible, </if> IF ( #{resolve} = 'true', 'yes', 'no' ) AS resolve FROM Navigation AS N <if test="resolve"> INNER JOIN NavigationEntry AS NE ON N.navigationId = NE.navigationId </if> WHERE N.navigationVisible = TRUE <if test="resolve"> AND NE.navigationEntryVisible = TRUE AND NE.navigationEntryTitle IS NOT NULL </if> </select> <select id="findHiddenNavigations" parameterType="boolean" resultMap="navigationResultMap"> <!-- SQL --> </select> <select id="findNavigation" parameterType="Map" resultMap="navigationResultMap"> <!-- SQL --> </select>
</mapper>

NavigationDAO.java:

package com.blockhaus2000.bh2k.portal.data.dao;
import java.util.SortedSet;
import com.blockhaus2000.bh2k.portal.data.model.Navigation;
public interface NavigationDAO extends BaseDAO<Navigation>, UpdateableDAO<Navigation> { SortedSet<Navigation> findVisibleNavigations(final boolean resolve); SortedSet<Navigation> findHiddenNavigations(final boolean resolve); Navigation findNavigation(final int id, final boolean resolve);
}

BaseDAO.java:

package com.blockhaus2000.bh2k.portal.data.dao;
import com.blockhaus2000.bh2k.portal.data.model.BaseModel;
public interface BaseDAO<T extends BaseModel<T>> { int insert(final T obj); int save(final T obj); int delete(final T obj); boolean exists(final T obj);
}

UpdateableDAO.java:

package com.blockhaus2000.bh2k.portal.data.dao;
import com.blockhaus2000.bh2k.portal.data.model.BaseModel;
public interface UpdateableDAO<T extends BaseModel<T>> extends BaseDAO<T> { int update(final T obj);
}

Everything is starting correctly, but on an invocation of

NavigationDAO.findVisibleNavigations(true) // Or false.

the following Exception is thrown:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'resolve' in 'class java.lang.Boolean' at org.mybatis.(...) at org.apache.ibatis.(...) at com.blockhaus2000.bh2k.portal.data.test.NavigationDAOSpec.test findVisibleNavigations(NavigationDAOSpec.groovy:224)
Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'resolve' in 'class java.lang.Boolean' at org.apache.ibatis.(...) at org.mybatis.(...) ... 5 more

That said, the solution may be to change the "parameterType" to "Map" and replacing "resolve" with "param1". But that does not work either. Also, if I remove the

<if test="..."> ... </if>

it does execute correctly (except for the functionaility, of course).


I am happy about every single answer.

Thanks for your help Fabian

asked 3 mins ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 334 تاريخ : جمعه 30 بهمن 1394 ساعت: 6:56

Vote count: 0

After the first training stage, the proccess is taking a lifetime to be completed. The parameters used are:

Raphaels-MacBook-Air:test19_volumeup_lessneg raphaelsantos$ opencv_traincascade -vec pos.vec -numPos 300 -bg negdir.txt -numNeg 20 -numStages 2 -data 1stage -w 60 -h 60 PARAMETERS: cascadeDirName: 1stage vecFileName: pos.vec bgFileName: negdir.txt numPos: 300 numNeg: 20 numStages: 2 precalcValBufSize[Mb] : 1024 precalcIdxBufSize[Mb] : 1024 acceptanceRatioBreakValue : -1 stageType: BOOST featureType: HAAR sampleWidth: 60 sampleHeight: 60 boostType: GAB minHitRate: 0.995 maxFalseAlarmRate: 0.5 weightTrimRate: 0.95 maxDepth: 1 maxWeakCount: 100 mode: BASIC

===== TRAINING 0-stage ===== END> Training until now has taken 0 days 0 hours 3 minutes 51 seconds.

===== TRAINING 1-stage =====

"RIGHT HERE THE TRAINING GETS BLOCKED, ANY IDEA WHY?!?"

asked 2 mins ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 348 تاريخ : جمعه 30 بهمن 1394 ساعت: 6:56

Vote count: 0

I have number of html files and each file has

<p>Some string</p>
<p>Some text</p>
<p>Some other text</p>
<p>Above this i want to add a string</p>
<p>Completed On: dd.mm.yyyy</p>
Rest of HTML page

The string "Completed On:" occurs only once in entire page.

Above the "Above this i want to add a string" --para I want to add a string say -- IDENTIFIER01.

The text Above this i want to add a string is variable and not fixed like Completed On: else i would have used patte matching.

How can this be done in PHP?

I am reading the file and keeping only needed html tags

$html = file_get_contents('file.html');
$strip = strip_tags("$html","<b>,<p>,<br>,<blockquote>,<ul>,<ol>,<li>,<u>,<i>,");

So would want to update $strip to add the string IDENTIFIER01 before moving to next stage of the code.

Thanks.

asked 2 mins ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 344 تاريخ : جمعه 30 بهمن 1394 ساعت: 2:37

Vote count: 0

I have website with array (list) of 1000 objects, these objects are loading from json to array every website refresh. I would like to load these objects from json to array only once and keep it in RAM for others users. Because everytime read file is much slower than read it from RAM.

I am using ASP.NET Web Forms

How is it posssible?

asked 2 mins ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 331 تاريخ : جمعه 30 بهمن 1394 ساعت: 2:37

Vote count: 0

I am facing some issue in xamarin.forms(in IOS) while using menuitem under context action in xamarin.forms listview. When i swipe the swipe menuitem works fine. But i do not want this menu item come under context action if some condition is met. Scenario-Suppose in xamarin listview i have selected row with value two then menuitem should come when i do swip. This is working fine. When i click on the menuitem it deletes the selected item and reset the listitem to value(zero) in this case i do not want the menu item to come with this when i do swip. Now if i again select any other value in listview then menu item should come when i do swip.So it kind of visibility change but there is no property in context action/menuitem. Note i am using MVVM Patte. Please try to provide solution in that way. Thanks In Advance.

asked 2 mins ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 334 تاريخ : جمعه 30 بهمن 1394 ساعت: 2:37

Vote count: 0

I have written the following (very simple) ring buffer class, which should allow array access via the @:arrayAccess macro:

class RingBuffer<T>
{ private var _elements : Array<T> = null; public function new(p_numElements : Int, p_defaultValue : T) { _elements = new Array<T>(); for (i in 0 ... p_numElements) { _elements.push(p_defaultValue); } } public function add(p_value : T) : Void { // Remove the first element _elements.splice(0, 1); _elements.push(p_value); } @:arrayAccess public inline function get(p_index : Int) { retu _elements[p_index]; } @:arrayAccess public inline function set(p_index : Int, p_value : T) { _elements[p_index] = p_value; retu p_value; }
}

But when I try to use array access on an instance of the class, I get an error telling me "Array access is not allowed on...".

Did I do something wrong in using the macro? I was basically following the example in the manual.

asked 3 mins ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 233 تاريخ : پنجشنبه 29 بهمن 1394 ساعت: 20:39

Vote count: 0

I'm making a game with Unity where player pick up a cookie and then player is jumping on y-axis. When player is jumping, he is twitching(very much). I want that jump and I want see that player is jumping smoothly. This is my sample of code

void OnTriggerEnter2D(Collider2D other)
{ if(other.gameObject.CompareTag("Player")) { player.velocity = new Vector2 (0, 0); player.AddForce(new Vector2(0,jumpHeight));
}

I tested about 1000f value of jumpHeight. Same problem is with higer or lower value.

Thanks and kind regards

asked 2 mins ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 304 تاريخ : پنجشنبه 29 بهمن 1394 ساعت: 20:39

Vote count: 0

in LAContext.h

/// @discussion This property can be set with a time interval in seconds. If the device was successfully unlocked by Touch ID within this time interval, then Touch ID authentication on this context will succeed automatically and the reply block will be called without prompting user for Touch ID.The default value is 0, meaning that no previous TouchID authentication can be reused.The maximum supported interval is 5 minutes and setting the value beyond 5 minutes does not increase the accepted interval.

@property (nonatomic) NSTimeInterval touchIDAuthenticationAllowableReuseDuration NS_AVAILABLE_IOS(9_0);

But When I Use this property has no effect

  • (void)viewDidLoad { [super viewDidLoad];

    self.transitioningDelegate = self; self.modalPresentationStyle = UIModalPresentationCustom;

    self.context.touchIDAuthenticationAllowableReuseDuration = 5;

    [self authenticationWithtouchID];

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self authenticationWithtouchID]; }); }

after 15 second,Ther context's TouchID still authentication can be Available

whats wrong????

asked 1 min ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 401 تاريخ : پنجشنبه 29 بهمن 1394 ساعت: 13:13

Vote count: 0

I'm trying to apply a HTML Bootstrap theme to a Rails application where I use HAML. The result can be found here: http://imgur.com/hhprZgh.

There seem to be some places in the code where I'm not converting it properly. Can you point out where those places might be? I can see in the console that all CSS files are loaded properly. Don't mind the fonts for now.

Thanks!

(It's the Moltran Responsive Admin Theme I'm using)

HAML:

.wrapper-page .panel.panel-color.panel-primary.panel-pages .panel-heading.bg-img .bg-overlay %h3.text-center.m-t-10.text-white Sign In to Founderdocs .panel-body = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %fieldset.form-control.input-lg .col-xs-12 = f.label :email = f.email_field :email, placeholder: User.human_attribute_name('email'), class: 'form-control' %fieldset.form-control.input-lg .col-xs-12 = f.label :password = f.password_field :password, placeholder: User.human_attribute_name('password'), class: 'form-control' .form-group .col-xs-12 - if devise_mapping.rememberable? .checkbox.checkbox-primary = f.label :remember_me do = f.check_box :remember_me Remember me .form-group.text-center.m-t-40 .col-xs-12 = f.submit t('.sign_in'), class: 'btn btn-primary' .form-group.m-t-30 .col-sm-7 %i.fa.fa-lock.m-r-5 = render 'devise/shared/linkdump' .col-sm-5.text-right %a{:href => "register.html"} Create an account

HTML:

<div class="wrapper-page"> <div class="panel panel-color panel-primary panel-pages"> <div class="panel-heading bg-img"> <div class="bg-overlay"></div> <h3 class="text-center m-t-10 text-white"> Sign In to <strong>Moltran</strong> </h3> </div> <div class="panel-body"> <form class="form-horizontal m-t-20" action="index.html"> <div class="form-group"> <div class="col-xs-12"> <input class="form-control input-lg" type="text" required="" placeholder="Useame"> </div> </div> <div class="form-group"> <div class="col-xs-12"> <input class="form-control input-lg" type="password" required="" placeholder="Password"> </div> </div> <div class="form-group"> <div class="col-xs-12"> <div class="checkbox checkbox-primary"> <input id="checkbox-signup" type="checkbox"> <label for="checkbox-signup"> Remember me </label> </div> </div> </div> <div class="form-group text-center m-t-40"> <div class="col-xs-12"> <button class="btn btn-primary btn-lg w-lg waves-effect waves-light" type="submit">Log In</button> </div> </div> <div class="form-group m-t-30"> <div class="col-sm-7"> <a href="recoverpw.html"><i class="fa fa-lock m-r-5"></i> Forgot your password?</a> </div> <div class="col-sm-5 text-right"> <a href="register.html">Create an account</a> </div> </div> </form> </div> </div>
</div>
asked 1 min ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 364 تاريخ : پنجشنبه 29 بهمن 1394 ساعت: 13:13

Vote count: 0

I have an EC2 instance on Amazon (AWS). The instance is behind a ELB (Elastic Load Balancer). I want to allow HTTPS connections to reach the EC2 instance.

Is it necessary to have the load balancer configured for HTTPS, ie, to check the certificates etc, or can this just be done traditionally within the EC2 instance and virtual host SSL configuration ?

The reason I'm asking is because I have allowed traffic via ELB -> EC2 for port 80 and 443, but only port 80 reaches the instance.

asked 1 min ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 306 تاريخ : پنجشنبه 29 بهمن 1394 ساعت: 13:13

Vote count: 0

I am developing SpriteKit universal iOS application that will contain many spritekit images. I was wondering if there are better methods for working with large amount of data images in iOS apps from what's available as default from Apple (i.e. texture atlases or image assets). Some resources point out that working with a database, like SQL, to save and load images data to/from a disk, improves the overall app performance in terms of memory resources.

What is the really best way to manage images content in the iOS application?

asked 1 min ago

- - , .

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 343 تاريخ : پنجشنبه 29 بهمن 1394 ساعت: 9:30